<%--
  Created by IntelliJ IDEA.
  User: fire'ge
  Date: 2022/4/30
  Time: 14:05
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<html>
<head>
    <title>查 看 订 单</title>
    <link rel="stylesheet" href="/TakeawaySystem/css/Show.css" type="text/css">
</head>
<body>
<div>
    <table id="name-label">
        <tr>
            <td align="center" colspan="4">你好！${user.username}
                <a href="/TakeawaySystem/jsp/UserCenter.jsp">退出</a>  </td>
        </tr>
    </table>
    <table>
        <tr>
            <td id= "tableTopic">
                定 单 详 情
            </td>
        </tr>
        <c:if test="${foods.size()>0}">

        <c:forEach begin="0" end="${foods.size()-1}" var="i">

        <form id="bookForm" method="post">
            <tr>
                <td class="shopTopic">
                    菜名：${foods[i].dishName}
                </td>
            </tr>
            <tr>
                <td>
                        ${books[i].bookNum}份
                </td>
                <td>
                       <c:if test="${books[i].conditionCode==0}">
                           未接单
                       </c:if>
                    <c:if test="${books[i].conditionCode==1}">
                        已接单
                    </c:if>
                </td>
            </tr>
            <td>
                <input type="hidden" value="${books[i].id}" name="bookId">
                <input Type="submit" id="delete" name="delete" Value="已 收 单" >
            </td>
        </form>
        </c:forEach>
        </c:if>
</body>
<script>
    let delete_ = document.getElementById("delete");
    delete_.onclick = deleteCart;
    function deleteCart()
    {
        document.getElementById("bookForm").action="deleteBook";
        document.getElementById("bookForm").submit();
    }
</script>
</html>
